package com.changgou.search.listener;

import com.changgou.goods.pojo.Spu;
import com.changgou.search.config.RabbitMQConfig;
import com.changgou.search.service.EsManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: 陈安
 * @Date: 2020/12/10$ 21:41$
 * @Description: $todo$
 * @Version 1.0
 */
@Component
public class SkuSearchDeleteListener {

    @Autowired
    private EsManagerService esManagerService;
    @RabbitListener(queues = RabbitMQConfig.SEARCH_DEL_QUEUE)
    public  void recceiveMessage(String spuId){
        System.out.println("接收到的id"+spuId);
        //调用业务层完成删除
        esManagerService.delSkuListBySpuId(spuId);

    }
}
